﻿using System.Diagnostics;
using System.Windows;
using MultiEventCommand.Classes;

namespace MultiEventCommand.UserControls
{
    /// <summary>
    /// Interaction logic for SupportUserControl.xaml
    /// </summary>
    public partial class SupportUserControl
    {
        public SupportUserControl()
        {
            InitializeComponent();

        }

        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=bhushanpoojary%40gmail%2ecom&lc=US&item_name=WPF%20Extended%20DatagRid%20Binder&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest");
        }

        private void HyperlinkRequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
        {
            TryCatch.BeginTryCatch(NavigateToLink,sender);
        }

        private void NavigateToLink(object obj)
        {
            var hyperlink = obj as System.Windows.Documents.Hyperlink;
            if(hyperlink!=null)
            {
                Process.Start(hyperlink.NavigateUri.ToString());
            }
        }
    }
}
